As a known method of detecting a line by use of an image processing method, as described above, there is a method wherein an image is converted to binary form and a position that changes from black to white or from white to black is detected. Another method is known wherein differentiation is performed by use of a matrix of pixels arranged in 3 rows and 3 columns.
The method wherein a line or an edge is detected by converting the image to binary form requires that the ambient brightness and the work condition be fixed, since the binary image changes with a change in the ambient brightness.
The method that employs a 3.times.3 matrix is affected by a local change of the brightness and hence cannot provide a clear image, so that, if the brightness of the image changes gently, points where the brightness changes, that is, the periphery of the image, cannot be found. In addition, if the image has a stain or the like adjacent a rectilinear line to be detected, there is a strong possibility of inviting an erroneous detection. In addition, since a large number of arithmetic operations are required, the processing speed is low.
Accordingly, these methods can be applied in a case where the input image is constant and clear, but not in inferior surroundings such as those in which an articulated industrial robot performs an operation, for example, welding.
In view of the above-described problems, it is an object of the present invention to provide a method of detecting a line or an edge as an object of detection with high reliability even in an operation performed in surroundings where conditions are not constant and the work is extremely stained.